.class Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;
.super Ljava/lang/Thread;
.source "ShareToMicroBlog.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/activity/ShareToMicroBlog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "postEditMessage4Sina"
.end annotation


# instance fields
.field private img:Ljava/lang/String;

.field private msg4sina:Ljava/lang/String;

.field private s:Ljava/lang/String;

.field private t:Ljava/lang/String;

.field final synthetic this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;


# direct methods
.method public constructor <init>(Lcom/netease/newsreader/activity/ShareToMicroBlog;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter
    .parameter "message"
    .parameter "t"
    .parameter "s"
    .parameter "img"

    .prologue
    .line 739
    iput-object p1, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    .line 734
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    .line 730
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    .line 731
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->t:Ljava/lang/String;

    .line 732
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->s:Ljava/lang/String;

    .line 733
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    .line 735
    iput-object p2, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    .line 736
    iput-object p3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->t:Ljava/lang/String;

    .line 737
    iput-object p4, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->s:Ljava/lang/String;

    .line 738
    iput-object p5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public run()V
    .locals 9

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 743
    new-instance v2, Landroid/os/Message;

    invoke-direct {v2}, Landroid/os/Message;-><init>()V

    .line 744
    .local v2, msg:Landroid/os/Message;
    iput v8, v2, Landroid/os/Message;->what:I

    .line 746
    const-string v5, "3857427664"

    sput-object v5, Lweibo4android/Weibo;->CONSUMER_KEY:Ljava/lang/String;

    .line 747
    const-string v5, "1901a3e5e35c98953ef4df53095ae02f"

    sput-object v5, Lweibo4android/Weibo;->CONSUMER_SECRET:Ljava/lang/String;

    .line 748
    const-string v5, "weibo4j.oauth.consumerKey"

    sget-object v6, Lweibo4android/Weibo;->CONSUMER_KEY:Ljava/lang/String;

    invoke-static {v5, v6}, Ljava/lang/System;->setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    .line 749
    const-string v5, "weibo4j.oauth.consumerSecret"

    sget-object v6, Lweibo4android/Weibo;->CONSUMER_SECRET:Ljava/lang/String;

    invoke-static {v5, v6}, Ljava/lang/System;->setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    .line 753
    :try_start_0
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v6, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    invoke-virtual {v5}, Lcom/netease/newsreader/activity/ShareToMicroBlog;->getShortUrl()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v6, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iput-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    .line 754
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    const-string v6, "utf-8"

    invoke-static {v5, v6}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    .line 755
    new-instance v4, Lweibo4android/Weibo;

    invoke-direct {v4}, Lweibo4android/Weibo;-><init>()V

    .line 756
    .local v4, weibo:Lweibo4android/Weibo;
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->t:Ljava/lang/String;

    iget-object v6, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->s:Ljava/lang/String;

    invoke-virtual {v4, v5, v6}, Lweibo4android/Weibo;->setToken(Ljava/lang/String;Ljava/lang/String;)V

    .line 758
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    invoke-static {v5}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 759
    const-string v5, "10.0.0.172"

    const/16 v6, 0x50

    invoke-virtual {v4, v5, v6}, Lweibo4android/Weibo;->setHttpProxy(Ljava/lang/String;I)V

    .line 762
    :cond_0
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    if-eqz v5, :cond_1

    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    const-string v6, ""

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-nez v5, :cond_1

    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    invoke-static {v5}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_1

    .line 763
    new-instance v5, Ljava/lang/StringBuilder;

    sget-object v6, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v6, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->img:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Lcom/netease/newsreader/activity/ShareToMicroBlog;->readFileImage(Ljava/lang/String;)[B

    move-result-object v0

    .line 764
    .local v0, content:[B
    new-instance v3, Lweibo4android/http/ImageItem;

    const-string v5, "pic"

    invoke-direct {v3, v5, v0}, Lweibo4android/http/ImageItem;-><init>(Ljava/lang/String;[B)V

    .line 765
    .local v3, pic:Lweibo4android/http/ImageItem;
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    invoke-virtual {v4, v5, v3}, Lweibo4android/Weibo;->uploadStatus(Ljava/lang/String;Lweibo4android/http/ImageItem;)Lweibo4android/Status;

    .line 770
    .end local v0           #content:[B
    .end local v3           #pic:Lweibo4android/http/ImageItem;
    :goto_0
    const/4 v5, 0x0

    iput v5, v2, Landroid/os/Message;->arg1:I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 782
    .end local v4           #weibo:Lweibo4android/Weibo;
    :goto_1
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    iget-object v5, v5, Lcom/netease/newsreader/activity/ShareToMicroBlog;->reflashormoreDataHandler:Landroid/os/Handler;

    invoke-virtual {v5, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 783
    return-void

    .line 767
    .restart local v4       #weibo:Lweibo4android/Weibo;
    :cond_1
    :try_start_1
    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4Sina;->msg4sina:Ljava/lang/String;

    invoke-virtual {v4, v5}, Lweibo4android/Weibo;->updateStatus(Ljava/lang/String;)Lweibo4android/Status;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 771
    .end local v4           #weibo:Lweibo4android/Weibo;
    :catch_0
    move-exception v1

    .line 773
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    .line 774
    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v5

    const-string v6, "40025"

    invoke-virtual {v5, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_2

    const/4 v5, 0x4

    iput v5, v2, Landroid/os/Message;->what:I

    goto :goto_1

    .line 775
    :cond_2
    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v5

    const-string v6, "40072"

    invoke-virtual {v5, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 776
    const/4 v5, 0x5

    iput v5, v2, Landroid/os/Message;->what:I

    .line 777
    iput v7, v2, Landroid/os/Message;->arg1:I

    goto :goto_1

    .line 779
    :cond_3
    iput v8, v2, Landroid/os/Message;->arg1:I

    goto :goto_1
.end method
